<#include "/common/head2.html"/> 
<div class="easyui-panel addPage" data-options="fit:true,border:false,novalidate:true">
	<form class="easyui-form" id="ff" method="post" data-options="novalidate:true">
		<table>
			<tr>
				<td>
					<span class="search_item">
				        <span class="adertisement">规则编号: </span>
				        <input required="true" class="easyui-validatebox" type="text" id="ruleCode" name="ruleCode" value="${rule.ruleCode!''}"></input>
					<span class="search_item">
				        <span class="adertisement">规则类型: </span>
				        <span class="item_obj">
							<!--  	通过字典添加 -->
		                    <select class="easyui-combobox" name="db_source" panelHeight="auto" style="width:100px" data-options="
		                    	url: '${basePath}/common/getDictData?queryParams[dict_type]=db_source',
		                    	valueField:'dict_key',
		                		textField:'dict_value'">
		                		<option value="${rule.type!''}"></option>
		                	</select>
			             </span>
					 </span>
				</td>
			</tr>
			
			<tr>
				<td>
					<span class="adertisement">规则区间：</span>
					<input required="true" class="easyui-validatebox" type="text" id="minValue" name="minValue" value="${rule.minValue!''}"></input>
					<input required="true" class="easyui-validatebox" type="text" id="mxValue" name="mxValue" value="${rule.mxValue!''}"></input>
				</td>
			</tr>
		
			<tr>
				<td>
					<span class="adertisement">规则分值：</span>
					<input required="true" class="easyui-validatebox" type="text" id="store" name="store" value="${rule.store!''}"></input>
				</td>
			</tr>
			
			<tr>
				<td>
					<span class="adertisement">规则描述：</span>
					<input required="true" class="easyui-validatebox" type="text" id="description" name="description" value="${rule.description!''}"></input>
					<!-- 获取id -->
					<input required="true" class="easyui-validatebox" type="hidden" id="id" name="id" value="${rule.id!''}" ></input>
				</td>
			</tr>
			
			<tr>
            	<td>
	            	<div data-options="region:'south',border:false" style="text-align: right; padding: 12px; border-top-width: 0px; border-top-style: solid; border-top-color: rgb(221, 221, 221); width: 674px; height: 28px;" title="" class="panel-body panel-body-noheader panel-body-noborder layout-body">
	            		<a class="easyui-linkbutton color1 l-btn l-btn-small" href="javascript:void(0)" onclick="javascript:save();" style="width: 220px;">
	            			<span class="l-btn-center" style="margin-top: 0px;"><span class="l-btn-text">确定</span></span>
	            		</a>
	        		</div>
            	</td>
            </tr>				
		</table>
	</form>
</div>
<script type="text/javascript">
function save() {
	$("#ff").form('submit', { 
        url: "updatePage", 
        onSubmit: function () {   
        	//表单提交前的回调函数 
        	if(!$("#ff").form('enableValidation').form('validate')) {
            	$.messager.alert('操作结果','请检查标红输入项','error');
        		return false;
        	}       	
        	
        }, 
        success: function (v) {
        	var v = eval('('+v+')');
        	var result = v.result;
        	if(result =='success'){
    	        	$.messager.alert('操作结果','修改成功！','info',function(){location.replace('list')});
    	        
        	}else{
    	        	$.messager.alert('操作结果','修改失败','error');
        	}
    	}
      }); 
}
</script>
<#include "/common/dialogWindow.html"/>
<#include "/common/foot.html"/>